﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiSpotLightTraitsData : OdGiLightTraitsData
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiSpotLightTraitsData(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiSpotLightTraitsData_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiSpotLightTraitsData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiSpotLightTraitsData()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiSpotLightTraitsData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGiSpotLightTraitsData() : this(GlobalsPINVOKE.new_OdGiSpotLightTraitsData(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d position()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiSpotLightTraitsData_position(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPosition(OdGePoint3d pos)
		{
			GlobalsPINVOKE.OdGiSpotLightTraitsData_setPosition(this.swigCPtr, OdGePoint3d.getCPtr(pos));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d target()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiSpotLightTraitsData_target(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTarget(OdGePoint3d trg)
		{
			GlobalsPINVOKE.OdGiSpotLightTraitsData_setTarget(this.swigCPtr, OdGePoint3d.getCPtr(trg));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiLightAttenuation attenuation()
		{
			OdGiLightAttenuation result = new OdGiLightAttenuation(GlobalsPINVOKE.OdGiSpotLightTraitsData_attenuation(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAttenuation(OdGiLightAttenuation atten)
		{
			GlobalsPINVOKE.OdGiSpotLightTraitsData_setAttenuation(this.swigCPtr, OdGiLightAttenuation.getCPtr(atten));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool setHotspotAndFalloff(double hotSpot, double falloff)
		{
			bool result = GlobalsPINVOKE.OdGiSpotLightTraitsData_setHotspotAndFalloff(this.swigCPtr, hotSpot, falloff);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double hotspot()
		{
			double result = GlobalsPINVOKE.OdGiSpotLightTraitsData_hotspot(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double falloff()
		{
			double result = GlobalsPINVOKE.OdGiSpotLightTraitsData_falloff(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double physicalIntensity()
		{
			double result = GlobalsPINVOKE.OdGiSpotLightTraitsData_physicalIntensity(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPhysicalIntensity(double intensity)
		{
			GlobalsPINVOKE.OdGiSpotLightTraitsData_setPhysicalIntensity(this.swigCPtr, intensity);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiColorRGB lampColor()
		{
			OdGiColorRGB result = new OdGiColorRGB(GlobalsPINVOKE.OdGiSpotLightTraitsData_lampColor(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLampColor(OdGiColorRGB color)
		{
			GlobalsPINVOKE.OdGiSpotLightTraitsData_setLampColor(this.swigCPtr, OdGiColorRGB.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
